package com.edushare.common.file.image;

import java.util.ArrayList;
import java.util.List;

import com.edushare.common.constants.ApplicationConstants;
import com.edushare.common.file.IFileProcessStrategy;
import com.edushare.common.file.ImageProcessingStrategy;

public class ProfileImages extends ImageProcessingStrategy {

	private static final long serialVersionUID = 428458131909794678L;

	/*public static String FILE_SUFFIX_ICON ="_icon";
	public static String FILE_SUFFIX_VBADGE ="_vbadge";
	public static String FILE_SUFFIX_HBADGE ="_hbadge";
	public static String FILE_SUFFIX_THUMB ="_thumb";*/
	
	@Override
	public List<ImageSpec> getImageVersions() {
		ArrayList<ImageSpec> imgVer = new ArrayList<ImageSpec>();
		
		//Icon
		ImageSpec icon = ImageSpec.instanceByFillInRectangle
							(ApplicationConstants.IMAGE_WIDTH_ICON, ApplicationConstants.IMAGE_HEIGHT_ICON);
		icon.setSuffix(ApplicationConstants.FILE_SUFFIX_ICON);
		imgVer.add(icon);
		
		//VBadge
		ImageSpec vbadge = ImageSpec.instanceByWidth(ApplicationConstants.IMAGE_WIDTH_VBADGE);
		vbadge.setSuffix(ApplicationConstants.FILE_SUFFIX_VBADGE);
		imgVer.add(vbadge);
		
		//HBadge
		ImageSpec hbadge = ImageSpec.instanceByFitInRectangle
								(ApplicationConstants.IMAGE_WIDTH_HBADGE, ApplicationConstants.IMAGE_HEIGHT_HBADGE);
		hbadge.setSuffix(ApplicationConstants.FILE_SUFFIX_HBADGE);
		imgVer.add(hbadge);
		
		//Thumb
		ImageSpec thumb = ImageSpec.instanceByFillInRectangle
								(ApplicationConstants.IMAGE_WIDTH_THUMB, ApplicationConstants.IMAGE_HEIGHT_THUMB);
		thumb.setSuffix(ApplicationConstants.FILE_SUFFIX_THUMB);
		imgVer.add(thumb);
		
		return imgVer;
	}

	public boolean processImmediately() {
		return true;
	}

	public int getProcessStrategyType() {
		return IFileProcessStrategy.PROCESS_STRATEGY_PROFILE_IMAGE;
	}

}
